package learn.spring.task;

import org.springframework.stereotype.Component;

import learn.spring.Timer;
import lombok.extern.slf4j.Slf4j;

/**
 * 同步任务
 * 
 * @author PinWei Wan
 * @since 2.6.9
 */
@Component
@Slf4j
public class SyncTask {

    public void doTaskOne() throws Exception {
        log.info("开始做【同步】任务一");

        // 模拟业务处理
        long cost = Timer.mock();

        log.info("完成任务一, 耗时: {}毫秒", cost);
    }

    public void doTaskTwo() throws Exception {
        log.info("开始做【同步】任务二");

        // 模拟业务处理
        long cost = Timer.mock();

        log.info("完成任务二, 耗时: {}毫秒", cost);

    }
}
